<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Kinetis Bootloader Host: Options Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Kinetis Bootloader Host
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
   <div id="projectbrief">Host Tools for Kinetis devices</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Introduction</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_options.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_options-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Options Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>parse command-line options  
 <a href="class_options.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="apps_2elftosb_2common_2options_8h_source.html">options.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a455ec724e9fbd8a18cb85284a58774b5"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5">OptCtrl</a> { <br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5ac80091c11929729ec1ca25417ead7f82">DEFAULT</a> = 0x00, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5aa27d19fd885e8e7b3d135d5359bd5d92">ANYCASE</a> = 0x01, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5a6f2d4beb8bc96f0bca7e80e891491fdf">QUIET</a> = 0x02, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5aad39c5430f4ed9c9986b1debfefd7930">PLUS</a> = 0x04, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5aa9aa58c832936f4d901b1904d3ccbc47">SHORT_ONLY</a> = 0x08, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5af1dd8a107767b5e3747466d7b6286f5f">LONG_ONLY</a> = 0x10, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5ac93daa1a0d1d90433f2857c3831b938c">NOGUESSING</a> = 0x20, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5aaf60f87bf78f46e3bb5eab09b3ae5511">PARSE_POS</a> = 0x40, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5ac80091c11929729ec1ca25417ead7f82">DEFAULT</a> = 0x00, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5aa27d19fd885e8e7b3d135d5359bd5d92">ANYCASE</a> = 0x01, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5a6f2d4beb8bc96f0bca7e80e891491fdf">QUIET</a> = 0x02, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5aad39c5430f4ed9c9986b1debfefd7930">PLUS</a> = 0x04, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5aa9aa58c832936f4d901b1904d3ccbc47">SHORT_ONLY</a> = 0x08, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5af1dd8a107767b5e3747466d7b6286f5f">LONG_ONLY</a> = 0x10, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5ac93daa1a0d1d90433f2857c3831b938c">NOGUESSING</a> = 0x20, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5aaf60f87bf78f46e3bb5eab09b3ae5511">PARSE_POS</a> = 0x40
<br />
 }</td></tr>
<tr class="separator:a455ec724e9fbd8a18cb85284a58774b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a39e2cec67d9659ada7fcb8a211223c73"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_options.html#a39e2cec67d9659ada7fcb8a211223c73">OptRC</a> { <br />
&#160;&#160;<b>ENDOPTS</b> = 0, 
<br />
&#160;&#160;<b>BADCHAR</b> = -1, 
<br />
&#160;&#160;<b>BADKWD</b> = -2, 
<br />
&#160;&#160;<b>AMBIGUOUS</b> = -3, 
<br />
&#160;&#160;<b>POSITIONAL</b> = -4, 
<br />
&#160;&#160;<b>ENDOPTS</b> = 0, 
<br />
&#160;&#160;<b>BADCHAR</b> = -1, 
<br />
&#160;&#160;<b>BADKWD</b> = -2, 
<br />
&#160;&#160;<b>AMBIGUOUS</b> = -3, 
<br />
&#160;&#160;<b>POSITIONAL</b> = -4
<br />
 }</td></tr>
<tr class="separator:a39e2cec67d9659ada7fcb8a211223c73"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a455ec724e9fbd8a18cb85284a58774b5"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5">OptCtrl</a> { <br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5ac80091c11929729ec1ca25417ead7f82">DEFAULT</a> = 0x00, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5aa27d19fd885e8e7b3d135d5359bd5d92">ANYCASE</a> = 0x01, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5a6f2d4beb8bc96f0bca7e80e891491fdf">QUIET</a> = 0x02, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5aad39c5430f4ed9c9986b1debfefd7930">PLUS</a> = 0x04, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5aa9aa58c832936f4d901b1904d3ccbc47">SHORT_ONLY</a> = 0x08, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5af1dd8a107767b5e3747466d7b6286f5f">LONG_ONLY</a> = 0x10, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5ac93daa1a0d1d90433f2857c3831b938c">NOGUESSING</a> = 0x20, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5aaf60f87bf78f46e3bb5eab09b3ae5511">PARSE_POS</a> = 0x40, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5ac80091c11929729ec1ca25417ead7f82">DEFAULT</a> = 0x00, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5aa27d19fd885e8e7b3d135d5359bd5d92">ANYCASE</a> = 0x01, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5a6f2d4beb8bc96f0bca7e80e891491fdf">QUIET</a> = 0x02, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5aad39c5430f4ed9c9986b1debfefd7930">PLUS</a> = 0x04, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5aa9aa58c832936f4d901b1904d3ccbc47">SHORT_ONLY</a> = 0x08, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5af1dd8a107767b5e3747466d7b6286f5f">LONG_ONLY</a> = 0x10, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5ac93daa1a0d1d90433f2857c3831b938c">NOGUESSING</a> = 0x20, 
<br />
&#160;&#160;<a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5aaf60f87bf78f46e3bb5eab09b3ae5511">PARSE_POS</a> = 0x40
<br />
 }</td></tr>
<tr class="separator:a455ec724e9fbd8a18cb85284a58774b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a39e2cec67d9659ada7fcb8a211223c73"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_options.html#a39e2cec67d9659ada7fcb8a211223c73">OptRC</a> { <br />
&#160;&#160;<b>ENDOPTS</b> = 0, 
<br />
&#160;&#160;<b>BADCHAR</b> = -1, 
<br />
&#160;&#160;<b>BADKWD</b> = -2, 
<br />
&#160;&#160;<b>AMBIGUOUS</b> = -3, 
<br />
&#160;&#160;<b>POSITIONAL</b> = -4, 
<br />
&#160;&#160;<b>ENDOPTS</b> = 0, 
<br />
&#160;&#160;<b>BADCHAR</b> = -1, 
<br />
&#160;&#160;<b>BADKWD</b> = -2, 
<br />
&#160;&#160;<b>AMBIGUOUS</b> = -3, 
<br />
&#160;&#160;<b>POSITIONAL</b> = -4
<br />
 }</td></tr>
<tr class="separator:a39e2cec67d9659ada7fcb8a211223c73"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a7425a07001387b9e2f080a704cc7cca3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7425a07001387b9e2f080a704cc7cca3"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>Options</b> (const char *<a class="el" href="class_options.html#a20f463d775bec67dbbfdaa2af371073f">name</a>, const char *const optv[])</td></tr>
<tr class="separator:a7425a07001387b9e2f080a704cc7cca3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a20f463d775bec67dbbfdaa2af371073f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a20f463d775bec67dbbfdaa2af371073f"></a>
const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_options.html#a20f463d775bec67dbbfdaa2af371073f">name</a> (void) const </td></tr>
<tr class="memdesc:a20f463d775bec67dbbfdaa2af371073f"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_options.html#a20f463d775bec67dbbfdaa2af371073f" title="name() returns the command name ">name()</a> returns the command name <br /></td></tr>
<tr class="separator:a20f463d775bec67dbbfdaa2af371073f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a966da6b84e47b7709ba43e8086b43f5c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a966da6b84e47b7709ba43e8086b43f5c"></a>
unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_options.html#a966da6b84e47b7709ba43e8086b43f5c">ctrls</a> (void) const </td></tr>
<tr class="memdesc:a966da6b84e47b7709ba43e8086b43f5c"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_options.html#a966da6b84e47b7709ba43e8086b43f5c" title="ctrls() (with no arguments) returns the existing control settings ">ctrls()</a> (with no arguments) returns the existing control settings <br /></td></tr>
<tr class="separator:a966da6b84e47b7709ba43e8086b43f5c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6beab96e1692d11866a54484f145d2f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa6beab96e1692d11866a54484f145d2f"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_options.html#aa6beab96e1692d11866a54484f145d2f">ctrls</a> (unsigned newctrls)</td></tr>
<tr class="memdesc:aa6beab96e1692d11866a54484f145d2f"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_options.html#a966da6b84e47b7709ba43e8086b43f5c" title="ctrls() (with no arguments) returns the existing control settings ">ctrls()</a> (with 1 argument) sets new control settings <br /></td></tr>
<tr class="separator:aa6beab96e1692d11866a54484f145d2f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0b329ebeeeb068b5f179fb434ae43e3a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0b329ebeeeb068b5f179fb434ae43e3a"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_options.html#a0b329ebeeeb068b5f179fb434ae43e3a">reset</a> (void)</td></tr>
<tr class="memdesc:a0b329ebeeeb068b5f179fb434ae43e3a"><td class="mdescLeft">&#160;</td><td class="mdescRight">reset for another pass to parse for options <br /></td></tr>
<tr class="separator:a0b329ebeeeb068b5f179fb434ae43e3a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6751b0899db689a12139b2a69ebe63eb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_options.html#a6751b0899db689a12139b2a69ebe63eb">usage</a> (std::ostream &amp;os, const char *positionals) const </td></tr>
<tr class="separator:a6751b0899db689a12139b2a69ebe63eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad31e1cd5a320e9feda434538b60eec6d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_options.html#ad31e1cd5a320e9feda434538b60eec6d">operator()</a> (<a class="el" href="class_opt_iter.html">OptIter</a> &amp;iter, const char *&amp;optarg)</td></tr>
<tr class="separator:ad31e1cd5a320e9feda434538b60eec6d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a559f537279e0a2bd5f8468cb1159f7ce"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_options.html#a559f537279e0a2bd5f8468cb1159f7ce">explicit_endopts</a> () const </td></tr>
<tr class="separator:a559f537279e0a2bd5f8468cb1159f7ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7425a07001387b9e2f080a704cc7cca3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7425a07001387b9e2f080a704cc7cca3"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>Options</b> (const char *<a class="el" href="class_options.html#a20f463d775bec67dbbfdaa2af371073f">name</a>, const char *const optv[])</td></tr>
<tr class="separator:a7425a07001387b9e2f080a704cc7cca3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a20f463d775bec67dbbfdaa2af371073f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a20f463d775bec67dbbfdaa2af371073f"></a>
const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_options.html#a20f463d775bec67dbbfdaa2af371073f">name</a> (void) const </td></tr>
<tr class="memdesc:a20f463d775bec67dbbfdaa2af371073f"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_options.html#a20f463d775bec67dbbfdaa2af371073f" title="name() returns the command name ">name()</a> returns the command name <br /></td></tr>
<tr class="separator:a20f463d775bec67dbbfdaa2af371073f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a966da6b84e47b7709ba43e8086b43f5c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a966da6b84e47b7709ba43e8086b43f5c"></a>
unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_options.html#a966da6b84e47b7709ba43e8086b43f5c">ctrls</a> (void) const </td></tr>
<tr class="memdesc:a966da6b84e47b7709ba43e8086b43f5c"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_options.html#a966da6b84e47b7709ba43e8086b43f5c" title="ctrls() (with no arguments) returns the existing control settings ">ctrls()</a> (with no arguments) returns the existing control settings <br /></td></tr>
<tr class="separator:a966da6b84e47b7709ba43e8086b43f5c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6beab96e1692d11866a54484f145d2f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa6beab96e1692d11866a54484f145d2f"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_options.html#aa6beab96e1692d11866a54484f145d2f">ctrls</a> (unsigned newctrls)</td></tr>
<tr class="memdesc:aa6beab96e1692d11866a54484f145d2f"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_options.html#a966da6b84e47b7709ba43e8086b43f5c" title="ctrls() (with no arguments) returns the existing control settings ">ctrls()</a> (with 1 argument) sets new control settings <br /></td></tr>
<tr class="separator:aa6beab96e1692d11866a54484f145d2f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0b329ebeeeb068b5f179fb434ae43e3a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0b329ebeeeb068b5f179fb434ae43e3a"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_options.html#a0b329ebeeeb068b5f179fb434ae43e3a">reset</a> (void)</td></tr>
<tr class="memdesc:a0b329ebeeeb068b5f179fb434ae43e3a"><td class="mdescLeft">&#160;</td><td class="mdescRight">reset for another pass to parse for options <br /></td></tr>
<tr class="separator:a0b329ebeeeb068b5f179fb434ae43e3a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6751b0899db689a12139b2a69ebe63eb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_options.html#a6751b0899db689a12139b2a69ebe63eb">usage</a> (std::ostream &amp;os, const char *positionals) const </td></tr>
<tr class="separator:a6751b0899db689a12139b2a69ebe63eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad31e1cd5a320e9feda434538b60eec6d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_options.html#ad31e1cd5a320e9feda434538b60eec6d">operator()</a> (<a class="el" href="class_opt_iter.html">OptIter</a> &amp;iter, const char *&amp;optarg)</td></tr>
<tr class="separator:ad31e1cd5a320e9feda434538b60eec6d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a559f537279e0a2bd5f8468cb1159f7ce"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_options.html#a559f537279e0a2bd5f8468cb1159f7ce">explicit_endopts</a> () const </td></tr>
<tr class="separator:a559f537279e0a2bd5f8468cb1159f7ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>parse command-line options </p>
<h1><a class="anchor" id="Synopsis"></a>
Synopsis</h1>
<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;options.h&gt;</span></div><div class="line"></div><div class="line"><a class="code" href="class_options.html">Options</a> opts(cmdname, optv);</div><div class="line"><span class="keywordtype">char</span> cmdname[], *optv[];</div></div><!-- fragment --> <h1><a class="anchor" id="Description"></a>
Description</h1>
<p>The <a class="el" href="class_options.html" title="parse command-line options ">Options</a> constructor expects a command-name (usually argv[0]) and a pointer to an array of strings. The last element in this array MUST be NULL. Each non-NULL string in the array must have the following format:</p>
<p>The 1st character must be the option-name ('c' for a -c option).</p>
<p>The 2nd character must be one of '|', '?', ':', '*', or '+'. '|' &ndash; indicates that the option takes NO argument; '?' &ndash; indicates that the option takes an OPTIONAL argument; ':' &ndash; indicates that the option takes a REQUIRED argument; '*' &ndash; indicates that the option takes 0 or more arguments; '+' &ndash; indicates that the option takes 1 or more arguments;</p>
<p>The remainder of the string must be the long-option name.</p>
<p>If desired, the long-option name may be followed by one or more spaces and then by the name of the option value. This name will be used when printing usage messages. If the option-value-name is not given then the string "&lt;value&gt;" will be used in usage messages.</p>
<p>One may use a space to indicate that a particular option does not have a corresponding long-option. For example, "c: " (or "c:") means the -c option takes a value &amp; has NO corresponding long-option.</p>
<p>To specify a long-option that has no corresponding single-character option is a bit trickier: Options::operator() still needs an "option-
  character" to return when that option is matched. One may use a whitespace character or a non-printable character as the single-character option in such a case. (hence " |hello" would only match "--hello").</p>
<h1><a class="anchor" id="Exceptions"></a>
Exceptions to the above</h1>
<p>If the 1st character of the string is '-', then the rest of the string must correspond to the above format, and the option is considered to be a hidden-option. This means it will be parsed when actually matching options from the command-line, but will NOT show-up if a usage message is printed using the <a class="el" href="class_options.html#a6751b0899db689a12139b2a69ebe63eb">usage()</a> member function. Such an example might be "-h|hidden". If you want to use any "dummy" options (options that are not parsed, but that to show up in the usage message), you can specify them along with any positional parameters to the <a class="el" href="class_options.html#a6751b0899db689a12139b2a69ebe63eb">usage()</a> member function.</p>
<p>If the 2nd character of the string is '\0' then it is assumed that there is no corresponding long-option and that the option takes no argument (hence "f", and "f| " are equivalent).</p>
<div class="fragment"><div class="line"><span class="keyword">const</span> <span class="keywordtype">char</span> * optv[] = {</div><div class="line">    <span class="stringliteral">&quot;c:count   &lt;number&gt;&quot;</span>,</div><div class="line">    <span class="stringliteral">&quot;s?str     &lt;string&gt;&quot;</span>,</div><div class="line">    <span class="stringliteral">&quot;x&quot;</span>,</div><div class="line">    <span class="stringliteral">&quot; |hello&quot;</span>,</div><div class="line">    <span class="stringliteral">&quot;g+groups  &lt;newsgroup&gt;&quot;</span>,</div><div class="line">    NULL</div><div class="line">} ;</div></div><!-- fragment --><p> optv[] now corresponds to the following: </p><pre class="fragment">  usage: cmdname [-c|--count &lt;number&gt;] [-s|--str [&lt;string&gt;]]
                 [-x] [--hello] [-g|--groups &lt;newsgroup&gt; ...]
</pre><p>Long-option names are matched case-insensitive and only a unique prefix of the name needs to be specified.</p>
<p>Option-name characters are case-sensitive!</p>
<h1><a class="anchor" id="Caveat"></a>
Caveat</h1>
<p>Because of the way in which multi-valued options and options with optional values are handled, it is NOT possible to supply a value to an option in a separate argument (different argv[] element) if the value is OPTIONAL and begins with a '-'. What this means is that if an option "-s" takes an optional value value and you wish to supply a value of "-foo" then you must specify this on the command-line as "-s-foo" instead of "-s -foo" because "-s -foo" will be considered to be two separate sets of options.</p>
<p>A multi-valued option is terminated by another option or by the end-of options. The following are all equivalent (if "-l" is a multi-valued option and "-x" is an option that takes no value):</p>
<p>cmdname -x -l item1 item2 item3 &ndash; arg1 arg2 arg3 cmdname -x -litem1 -litem2 -litem3 &ndash; arg1 arg2 arg3 cmdname -l item1 item2 item3 -x arg1 arg2 arg3</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;options.h&gt;</span></div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * optv[] = {</div><div class="line">   <span class="stringliteral">&quot;H|help&quot;</span>,</div><div class="line">   <span class="stringliteral">&quot;c:count   &lt;number&gt;&quot;</span>,</div><div class="line">   <span class="stringliteral">&quot;s?str     &lt;string&gt;&quot;</span>,</div><div class="line">   <span class="stringliteral">&quot;x&quot;</span>,</div><div class="line">   <span class="stringliteral">&quot; |hello&quot;</span>,</div><div class="line">   <span class="stringliteral">&quot;g+groups  &lt;newsgroup&gt;&quot;</span>,</div><div class="line">   NULL</div><div class="line">} ;</div><div class="line"></div><div class="line">main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> * argv[]) {</div><div class="line">   <span class="keywordtype">int</span>  optchar;</div><div class="line">   <span class="keyword">const</span> <span class="keywordtype">char</span> * optarg;</div><div class="line">   <span class="keyword">const</span> <span class="keywordtype">char</span> * str = <span class="stringliteral">&quot;default_string&quot;</span>;</div><div class="line">   <span class="keywordtype">int</span>  count = 0, xflag = 0, hello = 0;</div><div class="line">   <span class="keywordtype">int</span>  errors = 0, ngroups = 0;</div><div class="line"></div><div class="line">   <a class="code" href="class_options.html">Options</a>  opts(*argv, optv);</div><div class="line">   <a class="code" href="class_opt_argv_iter.html">OptArgvIter</a>  iter(--argc, ++argv);</div><div class="line"></div><div class="line">   <span class="keywordflow">while</span>( optchar = opts(iter, optarg) ) {</div><div class="line">      <span class="keywordflow">switch</span> (optchar) {</div><div class="line">      <span class="keywordflow">case</span> <span class="charliteral">&#39;H&#39;</span> :</div><div class="line">         opts.usage(cout, <span class="stringliteral">&quot;files ...&quot;</span>);</div><div class="line">         exit(0);</div><div class="line">         <span class="keywordflow">break</span>;</div><div class="line">      <span class="keywordflow">case</span> <span class="charliteral">&#39;g&#39;</span> :</div><div class="line">         ++ngroups; <span class="keywordflow">break</span>;  </div><div class="line">      <span class="keywordflow">case</span> <span class="charliteral">&#39;s&#39;</span> :</div><div class="line">         str = optarg; <span class="keywordflow">break</span>;</div><div class="line">      <span class="keywordflow">case</span> <span class="charliteral">&#39;x&#39;</span> :</div><div class="line">         ++xflag; <span class="keywordflow">break</span>;</div><div class="line">      <span class="keywordflow">case</span> <span class="charliteral">&#39; &#39;</span> :</div><div class="line">         ++hello; <span class="keywordflow">break</span>;</div><div class="line">      <span class="keywordflow">case</span> <span class="charliteral">&#39;c&#39;</span> :</div><div class="line">         <span class="keywordflow">if</span> (optarg == NULL)  ++errors;</div><div class="line">         <span class="keywordflow">else</span>  count = (int) atol(optarg);</div><div class="line">         <span class="keywordflow">break</span>;</div><div class="line">      <span class="keywordflow">default</span> :  ++errors; <span class="keywordflow">break</span>;</div><div class="line">      } </div><div class="line">   }</div><div class="line"></div><div class="line">   <span class="keywordflow">if</span> (errors || (iter.index() == argc)) {</div><div class="line">      <span class="keywordflow">if</span> (! errors) {</div><div class="line">         cerr &lt;&lt; opts.name() &lt;&lt; <span class="stringliteral">&quot;: no filenames given.&quot;</span> &lt;&lt; endl ;</div><div class="line">      }</div><div class="line">      opts.usage(cerr, <span class="stringliteral">&quot;files ...&quot;</span>);</div><div class="line">      exit(1);</div><div class="line">   }</div><div class="line"></div><div class="line">   cout &lt;&lt; <span class="stringliteral">&quot;xflag=&quot;</span> &lt;&lt; ((xflag) ? <span class="stringliteral">&quot;ON&quot;</span>  : <span class="stringliteral">&quot;OFF&quot;</span>) &lt;&lt; endl</div><div class="line">        &lt;&lt; <span class="stringliteral">&quot;hello=&quot;</span> &lt;&lt; ((hello) ? <span class="stringliteral">&quot;YES&quot;</span> : <span class="stringliteral">&quot;NO&quot;</span>) &lt;&lt; endl</div><div class="line">        &lt;&lt; <span class="stringliteral">&quot;count=&quot;</span> &lt;&lt; count &lt;&lt; endl</div><div class="line">        &lt;&lt; <span class="stringliteral">&quot;str=\&quot;&quot;</span> &lt;&lt; ((str) ? str : <span class="stringliteral">&quot;No value given!&quot;</span>) &lt;&lt; <span class="stringliteral">&quot;\&quot;&quot;</span> &lt;&lt; endl</div><div class="line">        &lt;&lt; <span class="stringliteral">&quot;ngroups=&quot;</span> &lt;&lt; ngroups &lt;&lt; endl ;</div><div class="line"></div><div class="line">   <span class="keywordflow">if</span> (iter.index() &lt; argc) {</div><div class="line">      cout &lt;&lt; <span class="stringliteral">&quot;files=&quot;</span> ;</div><div class="line">      <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = iter.index() ; i &lt; argc ; i++) {</div><div class="line">         cout &lt;&lt; <span class="stringliteral">&quot;\&quot;&quot;</span> &lt;&lt; argv[i] &lt;&lt; <span class="stringliteral">&quot;\&quot; &quot;</span> ;</div><div class="line">      }</div><div class="line">      cout &lt;&lt; endl ;</div><div class="line">   }</div><div class="line">}</div></div><!-- fragment --> </div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5">Options::OptCtrl</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5ac80091c11929729ec1ca25417ead7f82"></a>DEFAULT&#160;</td><td class="fielddoc">
<p>Default setting. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5aa27d19fd885e8e7b3d135d5359bd5d92"></a>ANYCASE&#160;</td><td class="fielddoc">
<p>Ignore case when matching short-options. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5a6f2d4beb8bc96f0bca7e80e891491fdf"></a>QUIET&#160;</td><td class="fielddoc">
<p>Dont print error messages. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5aad39c5430f4ed9c9986b1debfefd7930"></a>PLUS&#160;</td><td class="fielddoc">
<p>Allow "+" as a long-option prefix. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5aa9aa58c832936f4d901b1904d3ccbc47"></a>SHORT_ONLY&#160;</td><td class="fielddoc">
<p>Dont accept long-options. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5af1dd8a107767b5e3747466d7b6286f5f"></a>LONG_ONLY&#160;</td><td class="fielddoc">
<p>Dont accept short-options (also allows "-" as a long-option prefix). </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5ac93daa1a0d1d90433f2857c3831b938c"></a>NOGUESSING&#160;</td><td class="fielddoc">
<p>Normally, when we see a short (long) option on the command line that doesnt match any known short (long) options, then we try to "guess" by seeing if it will match any known long (short) option. Setting this mask prevents this "guessing" from occurring. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5aaf60f87bf78f46e3bb5eab09b3ae5511"></a>PARSE_POS&#160;</td><td class="fielddoc">
<p>By default, <a class="el" href="class_options.html" title="parse command-line options ">Options</a> will not present positional command-line arguments to the user and will instead stop parsing when the first positonal argument has been encountered. If this flag is given, <a class="el" href="class_options.html" title="parse command-line options ">Options</a> will present positional arguments to the user with a return code of POSITIONAL; ENDOPTS will be returned only when the end of the argument list is reached. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5ac80091c11929729ec1ca25417ead7f82"></a>DEFAULT&#160;</td><td class="fielddoc">
<p>Default setting. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5aa27d19fd885e8e7b3d135d5359bd5d92"></a>ANYCASE&#160;</td><td class="fielddoc">
<p>Ignore case when matching short-options. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5a6f2d4beb8bc96f0bca7e80e891491fdf"></a>QUIET&#160;</td><td class="fielddoc">
<p>Dont print error messages. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5aad39c5430f4ed9c9986b1debfefd7930"></a>PLUS&#160;</td><td class="fielddoc">
<p>Allow "+" as a long-option prefix. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5aa9aa58c832936f4d901b1904d3ccbc47"></a>SHORT_ONLY&#160;</td><td class="fielddoc">
<p>Dont accept long-options. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5af1dd8a107767b5e3747466d7b6286f5f"></a>LONG_ONLY&#160;</td><td class="fielddoc">
<p>Dont accept short-options (also allows "-" as a long-option prefix). </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5ac93daa1a0d1d90433f2857c3831b938c"></a>NOGUESSING&#160;</td><td class="fielddoc">
<p>Normally, when we see a short (long) option on the command line that doesnt match any known short (long) options, then we try to "guess" by seeing if it will match any known long (short) option. Setting this mask prevents this "guessing" from occurring. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5aaf60f87bf78f46e3bb5eab09b3ae5511"></a>PARSE_POS&#160;</td><td class="fielddoc">
<p>By default, <a class="el" href="class_options.html" title="parse command-line options ">Options</a> will not present positional command-line arguments to the user and will instead stop parsing when the first positonal argument has been encountered. If this flag is given, <a class="el" href="class_options.html" title="parse command-line options ">Options</a> will present positional arguments to the user with a return code of POSITIONAL; ENDOPTS will be returned only when the end of the argument list is reached. </p>
</td></tr>
</table>

</div>
</div>
<a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5">Options::OptCtrl</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5ac80091c11929729ec1ca25417ead7f82"></a>DEFAULT&#160;</td><td class="fielddoc">
<p>Default setting. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5aa27d19fd885e8e7b3d135d5359bd5d92"></a>ANYCASE&#160;</td><td class="fielddoc">
<p>Ignore case when matching short-options. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5a6f2d4beb8bc96f0bca7e80e891491fdf"></a>QUIET&#160;</td><td class="fielddoc">
<p>Dont print error messages. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5aad39c5430f4ed9c9986b1debfefd7930"></a>PLUS&#160;</td><td class="fielddoc">
<p>Allow "+" as a long-option prefix. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5aa9aa58c832936f4d901b1904d3ccbc47"></a>SHORT_ONLY&#160;</td><td class="fielddoc">
<p>Dont accept long-options. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5af1dd8a107767b5e3747466d7b6286f5f"></a>LONG_ONLY&#160;</td><td class="fielddoc">
<p>Dont accept short-options (also allows "-" as a long-option prefix). </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5ac93daa1a0d1d90433f2857c3831b938c"></a>NOGUESSING&#160;</td><td class="fielddoc">
<p>Normally, when we see a short (long) option on the command line that doesnt match any known short (long) options, then we try to "guess" by seeing if it will match any known long (short) option. Setting this mask prevents this "guessing" from occurring. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5aaf60f87bf78f46e3bb5eab09b3ae5511"></a>PARSE_POS&#160;</td><td class="fielddoc">
<p>By default, <a class="el" href="class_options.html" title="parse command-line options ">Options</a> will not present positional command-line arguments to the user and will instead stop parsing when the first positonal argument has been encountered. If this flag is given, <a class="el" href="class_options.html" title="parse command-line options ">Options</a> will present positional arguments to the user with a return code of POSITIONAL; ENDOPTS will be returned only when the end of the argument list is reached. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5ac80091c11929729ec1ca25417ead7f82"></a>DEFAULT&#160;</td><td class="fielddoc">
<p>Default setting. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5aa27d19fd885e8e7b3d135d5359bd5d92"></a>ANYCASE&#160;</td><td class="fielddoc">
<p>Ignore case when matching short-options. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5a6f2d4beb8bc96f0bca7e80e891491fdf"></a>QUIET&#160;</td><td class="fielddoc">
<p>Dont print error messages. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5aad39c5430f4ed9c9986b1debfefd7930"></a>PLUS&#160;</td><td class="fielddoc">
<p>Allow "+" as a long-option prefix. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5aa9aa58c832936f4d901b1904d3ccbc47"></a>SHORT_ONLY&#160;</td><td class="fielddoc">
<p>Dont accept long-options. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5af1dd8a107767b5e3747466d7b6286f5f"></a>LONG_ONLY&#160;</td><td class="fielddoc">
<p>Dont accept short-options (also allows "-" as a long-option prefix). </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5ac93daa1a0d1d90433f2857c3831b938c"></a>NOGUESSING&#160;</td><td class="fielddoc">
<p>Normally, when we see a short (long) option on the command line that doesnt match any known short (long) options, then we try to "guess" by seeing if it will match any known long (short) option. Setting this mask prevents this "guessing" from occurring. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a455ec724e9fbd8a18cb85284a58774b5aaf60f87bf78f46e3bb5eab09b3ae5511"></a>PARSE_POS&#160;</td><td class="fielddoc">
<p>By default, <a class="el" href="class_options.html" title="parse command-line options ">Options</a> will not present positional command-line arguments to the user and will instead stop parsing when the first positonal argument has been encountered. If this flag is given, <a class="el" href="class_options.html" title="parse command-line options ">Options</a> will present positional arguments to the user with a return code of POSITIONAL; ENDOPTS will be returned only when the end of the argument list is reached. </p>
</td></tr>
</table>

</div>
</div>
<a class="anchor" id="a39e2cec67d9659ada7fcb8a211223c73"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="class_options.html#a39e2cec67d9659ada7fcb8a211223c73">Options::OptRC</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Error return values for operator() </p>

</div>
</div>
<a class="anchor" id="a39e2cec67d9659ada7fcb8a211223c73"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="class_options.html#a39e2cec67d9659ada7fcb8a211223c73">Options::OptRC</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Error return values for operator() </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a559f537279e0a2bd5f8468cb1159f7ce"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int Options::explicit_endopts </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Call this member function after operator() has returned 0 if you want to know whether or not options were explicitly terminated because "--" appeared on the command-line. </p>

</div>
</div>
<a class="anchor" id="a559f537279e0a2bd5f8468cb1159f7ce"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int Options::explicit_endopts </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Call this member function after operator() has returned 0 if you want to know whether or not options were explicitly terminated because "--" appeared on the command-line. </p>

</div>
</div>
<a class="anchor" id="ad31e1cd5a320e9feda434538b60eec6d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Options::operator() </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_opt_iter.html">OptIter</a> &amp;&#160;</td>
          <td class="paramname"><em>iter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&amp;&#160;</td>
          <td class="paramname"><em>optarg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>operator() iterates through the arguments as necessary (using the given iterator) and returns the character value of the option (or long-option) that it matched. If the option has a value then the value given may be found in optarg (otherwise optarg will be NULL).</p>
<p>0 is returned upon end-of-options. At this point, "iter" may be used to process any remaining positional parameters. If the PARSE_POS control-flag is set then 0 is returned only when all arguments in "iter" have been exhausted.</p>
<p>If an invalid option is found then BADCHAR is returned and *optarg is the unrecognized option character.</p>
<p>If an invalid long-option is found then BADKWD is returned and optarg points to the bad long-option.</p>
<p>If an ambiguous long-option is found then AMBIGUOUS is returned and optarg points to the ambiguous long-option.</p>
<p>If the PARSE_POS control-flag is set then POSITIONAL is returned when a positional argument is encountered and optarg points to the positonal argument (and "iter" is advanced to the next argument in the iterator).</p>
<p>Unless <a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5a6f2d4beb8bc96f0bca7e80e891491fdf" title="Dont print error messages. ">Options::QUIET</a> is used, missing option-arguments and invalid options (and the like) will automatically cause error messages to be issued to cerr. </p>

</div>
</div>
<a class="anchor" id="ad31e1cd5a320e9feda434538b60eec6d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Options::operator() </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_opt_iter.html">OptIter</a> &amp;&#160;</td>
          <td class="paramname"><em>iter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&amp;&#160;</td>
          <td class="paramname"><em>optarg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>operator() iterates through the arguments as necessary (using the given iterator) and returns the character value of the option (or long-option) that it matched. If the option has a value then the value given may be found in optarg (otherwise optarg will be NULL).</p>
<p>0 is returned upon end-of-options. At this point, "iter" may be used to process any remaining positional parameters. If the PARSE_POS control-flag is set then 0 is returned only when all arguments in "iter" have been exhausted.</p>
<p>If an invalid option is found then BADCHAR is returned and *optarg is the unrecognized option character.</p>
<p>If an invalid long-option is found then BADKWD is returned and optarg points to the bad long-option.</p>
<p>If an ambiguous long-option is found then AMBIGUOUS is returned and optarg points to the ambiguous long-option.</p>
<p>If the PARSE_POS control-flag is set then POSITIONAL is returned when a positional argument is encountered and optarg points to the positonal argument (and "iter" is advanced to the next argument in the iterator).</p>
<p>Unless <a class="el" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5a6f2d4beb8bc96f0bca7e80e891491fdf" title="Dont print error messages. ">Options::QUIET</a> is used, missing option-arguments and invalid options (and the like) will automatically cause error messages to be issued to cerr. </p>

</div>
</div>
<a class="anchor" id="a6751b0899db689a12139b2a69ebe63eb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Options::usage </td>
          <td>(</td>
          <td class="paramtype">std::ostream &amp;&#160;</td>
          <td class="paramname"><em>os</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>positionals</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p><a class="el" href="class_options.html#a6751b0899db689a12139b2a69ebe63eb">usage()</a> prints options usage (followed by any positional arguments listed in the parameter "positionals") on the given outstream </p>

</div>
</div>
<a class="anchor" id="a6751b0899db689a12139b2a69ebe63eb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Options::usage </td>
          <td>(</td>
          <td class="paramtype">std::ostream &amp;&#160;</td>
          <td class="paramname"><em>os</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>positionals</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p><a class="el" href="class_options.html#a6751b0899db689a12139b2a69ebe63eb">usage()</a> prints options usage (followed by any positional arguments listed in the parameter "positionals") on the given outstream </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="apps_2elftosb_2common_2options_8h_source.html">apps/elftosb/common/options.h</a></li>
<li>apps/elftosb/common/options.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_options.html">Options</a></li>
    <li class="footer">Generated on Mon Mar 7 2016 16:49:51 for Kinetis Bootloader Host by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
